-- GENERATED SPELL FOR [Thel'zan the Duskbringer] --


function spell0_27383(pUnit, Event) --@Chains of Ice,n/a--
pUnit:FullCastSpellOnTarget(39268,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_27383', 11000, 1)
end

function spell1_27383(pUnit, Event) --@Frost Armor,Self--
pUnit:FullCastSpellOnTarget(31256,pUnit)
pUnit:RegisterEvent('Sorts_27383', 10000, 1)
end

function spell2_27383(pUnit, Event) --@Frostbolt,n/a--
pUnit:FullCastSpellOnTarget(42719,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_27383', 6000, 1)
end

function spell3_27383(pUnit, Event) --@Frostbolt Volley,Self--
pUnit:FullCastSpellOnTarget(22643,pUnit)
pUnit:RegisterEvent('Sorts_27383', 5500, 1)
end

function spell4_27383(pUnit, Event) --@Scream of Chaos,Self--
pUnit:FullCastSpellOnTarget(50497,pUnit)
pUnit:RegisterEvent('Sorts_27383', 10000, 1)
end

function Sorts_27383(pUnit, Event)
local choix_sorts_27383 = math.random(0, 4)
if choix_sorts_27383 == 0 then
pUnit:RegisterEvent('spell0_27383', 1, 1)
end
if choix_sorts_27383 == 1 then
pUnit:RegisterEvent('spell1_27383', 1, 1)
end
if choix_sorts_27383 == 2 then
pUnit:RegisterEvent('spell2_27383', 1, 1)
end
if choix_sorts_27383 == 3 then
pUnit:RegisterEvent('spell3_27383', 1, 1)
end
if choix_sorts_27383 == 4 then
pUnit:RegisterEvent('spell4_27383', 1, 1)
end
end

function mob27383_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_27383', math.random(1500, 3000), 1)
end

function mob27383_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob27383_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob27383_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(27383, 1, 'mob27383_Action')
RegisterUnitEvent(27383, 2, 'mob27383_Leave')
RegisterUnitEvent(27383, 3, 'mob27383_Kill')
RegisterUnitEvent(27383, 4, 'mob27383_Die')
